function isPrimeNumber(n) {
    if (n == 0 || n == 1) {
        return false;
    } else {
        let count = 0;
        for (let i = n; i > 0; i--) {
            if (n % i == 0) {
                count++;
            }
        }
        if (count == 2) {
            return true;

        } else {
            return false;
        }
    }
}
// let n=2;
// console.log(isPrimeNumber( n ));

//用函数统计N以内的质数
function countPrime(n) {
    // 判断一个整数是否为质数可以使用 isPrimeNumber 函数来实现
    let count = 0;
    let count_sum = 0;
    for (let i = 1; i <= n; i++) {
        for (let j = 1; j <= i; j++) {
            if (i % j == 0) {
                count++;
            }
        }
        if (count == 2) {

            count_sum = count_sum + 1;
        }
        count = 0;
    }
    return count_sum;
}
//  let n=100;
//  console.log(countPrime( n ));

//用函数输出N个质数
function showPrime(n) {
    // 判断一个整数是否为质数可以使用 isPrimeNumber 函数来实现 
    let total = 0;
    let count = 0;
    let m = 2;
    let s = '';
    while (total < n) {

        for (let i = 1; i <= m; i++) {
            if (m % i == 0) {
                count++;
            }
        }
        if (count == 2) {

            // process.stdout.write(n + '\t');//输出不换行
            total = total + 1;
            s = s + m + (total % 10 == 0 ? '' : '\t');
            if (total % 10 == 0) {
                console.log(s);
                // console.log('\n');
                s = '';
            }
        }
        count = 0;
        m = m + 1;
    }
    if (s) {
        console.log(s);
    }
}
// let n = 99;
// showPrime(n);